package com.goldze.mvvmhabit.data.source.http.service;

import com.goldze.mvvmhabit.entity.DemoEntity;
import com.goldze.mvvmhabit.entity.request.AddLeaveFormRequestEntity;
import com.goldze.mvvmhabit.entity.request.ChangePswRequestEntity;
import com.goldze.mvvmhabit.entity.request.DelectFriendEntity;
import com.goldze.mvvmhabit.entity.request.ForgetPswRequestEntity;
import com.goldze.mvvmhabit.entity.request.GetHistoryMsgRequestEntity;
import com.goldze.mvvmhabit.entity.request.GetLeaveListRequestEntity;
import com.goldze.mvvmhabit.entity.request.LoginRequestEntity;
import com.goldze.mvvmhabit.entity.request.ModifyDepartRequestEntity;
import com.goldze.mvvmhabit.entity.request.RegisterRequestEntity;
import com.goldze.mvvmhabit.entity.request.SendMsgRequestEntity;
import com.goldze.mvvmhabit.entity.request.SendSmsCodeRequestEntity;
import com.goldze.mvvmhabit.entity.request.SetHasReadRequestEntity;
import com.goldze.mvvmhabit.entity.request.SexRequestEntity;
import com.goldze.mvvmhabit.entity.request.UploadHeadRequestEntity;
import com.goldze.mvvmhabit.entity.response.CompanyResponseEntity;
import com.goldze.mvvmhabit.entity.response.GetBannerListResponseEntity;
import com.goldze.mvvmhabit.entity.response.GetChatUsersResponseEntity;
import com.goldze.mvvmhabit.entity.response.GetHistoryMsgResponseEntity;
import com.goldze.mvvmhabit.entity.response.GetLeaveListResponseEntity;
import com.goldze.mvvmhabit.entity.response.GetNewMsgResponseEntity;
import com.goldze.mvvmhabit.entity.response.GetTypeListResponseEntity;
import com.goldze.mvvmhabit.entity.response.LoginResponseEntity;
import com.goldze.mvvmhabit.entity.response.RegisterResponseEntity;
import com.goldze.mvvmhabit.entity.response.SelectDepartmentResponseEntity;
import com.goldze.mvvmhabit.entity.response.UserInfoResponseEntity;
import com.goldze.mvvmhabit.entity.response.VersionResponseEntity;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseResponse;
import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

/**
 * Created by goldze on 2017/6/15.
 */

public interface DemoApiService {

    @GET("action/apiv2/banner?catalog=1")
    Observable<BaseResponse<DemoEntity>> demoGet();

    @FormUrlEncoded
    @POST("action/apiv2/banner")
    Observable<BaseResponse<DemoEntity>> demoPost(@Field("catalog") String catalog);

    @POST("api/User/LoginByPassWord")
    Observable<BaseResponse<LoginResponseEntity>> loginbypassword(@Body LoginRequestEntity params);

    @POST("api/User/GetUserInfo")
    Observable<BaseResponse<UserInfoResponseEntity>> getUserInfo();

    @POST("api/User/Register")
    Observable<BaseResponse<RegisterResponseEntity>> register(@Body RegisterRequestEntity params);

    @POST("api/User/SendSmsCode")
    Observable<BaseResponse<String>> sendSmsCode(@Body SendSmsCodeRequestEntity params);

    @POST("api/Leave/GetLeaveList")
    Observable<BaseResponse<GetLeaveListResponseEntity>> getLeaveList(@Body GetLeaveListRequestEntity params);

    @POST("api/User/GetDepartList")
    Observable<BaseResponse<List<SelectDepartmentResponseEntity>>> getDepartList();

    @POST("api/User/ModifyDepart")
    Observable<BaseResponse<Boolean>> modifyDepart(@Body ModifyDepartRequestEntity params);

    @POST("api/User/SetUserSex")
    Observable<BaseResponse<Boolean>> setUserSex(@Body SexRequestEntity params);

    @POST("api/Leave/GetBannerList")
    Observable<BaseResponse<ArrayList<GetBannerListResponseEntity>>> getBannerList();

    @POST("api/Leave/AddLeaveForm")
    Observable<BaseResponse<String>> addLeaveForm(@Body AddLeaveFormRequestEntity entity);

    @POST("api/Leave/GetTypeList")
    Observable<BaseResponse<ArrayList<GetTypeListResponseEntity>>> getTypeList();

    @Multipart
    @POST("api/Leave/UploadImg")
    Observable<BaseResponse<String>> upLoadImg(@Part List<MultipartBody.Part> file);

    @POST("api/User/ModifyAvatar")
    Observable<BaseResponse<Boolean>> uploadHead(@Body UploadHeadRequestEntity entity);

    @POST("api/Leave/GetChatUsers")
    Observable<BaseResponse<List<GetChatUsersResponseEntity>>> getChatUsers();

    @POST("api/Leave/DeleteFriend")
    Observable<BaseResponse<String>> DelectUsers(@Body DelectFriendEntity entity);

    @POST("api/Leave/GetHistoryMsg")
    Observable<BaseResponse<List<GetHistoryMsgResponseEntity>>> getHistoryMsg(@Body GetHistoryMsgRequestEntity entity);

    @POST("api/Leave/SendMsg")
    Observable<BaseResponse<String>> sendMsg(@Body SendMsgRequestEntity entity);

    @POST("api/Leave/SetHasRead")
    Observable<BaseResponse<String>> setHasRead(@Body SetHasReadRequestEntity entity);

    @POST("api/Leave/GetNewMsg")
    Observable<BaseResponse<List<GetNewMsgResponseEntity>>> getNewMsg();

    @Headers({"accept: application/json"})
    @POST("api/User/GetCompanyInfo")
    Observable<BaseResponse<String>> getCompanyInfo();

    @POST("api/User/GetCompany")
    Observable<BaseResponse<CompanyResponseEntity>> GetCompany();

    @POST("api/Leave/CheckVersion")
    Observable<BaseResponse<VersionResponseEntity>> getCheckVersion();

    @POST("api/User/ModifyPwd")
    Observable<BaseResponse<Boolean>> modifyPwd(@Body ChangePswRequestEntity params);

    @POST("api/User/ForgetPassWord")
    Observable<BaseResponse<String>> forgetPwd(@Body ForgetPswRequestEntity params);


}
